#!/bin/bash

main(){
user=$1
pass=$2
docker pull bestoray/pgyvpn;
docker rm pgyvpn --force||echo 'no container......'
docker run -dit \
--net host \
--privileged \
--cap-add NET_ADMIN \
--env PGY_USERNAME="${user}" \
--env  PGY_PASSWORD="${pass}" \
--name pgyvpn \
--hostname pgyvpn \
--restart always \
bestoray/pgyvpn:latest

docker images|grep '<none>'|awk '{print$3}'|xargs docker rmi;

}

main $1 $2 